<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>时间轴</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<meta name="decorator" content="ani"/>
	<link rel="stylesheet" href="${ctxStatic}/common/css/timeAxis.css">
<body>
<div class="content">
  <div class="wrapper">
    <div class="light"><i></i></div>
    <hr class="line-left">
    <hr class="line-right">
    <div class="main">
      <h1 class="title">资源生命周期</h1>
      <div class="year">
        <h2></h2>
        <div class="list">
          <ul id="timeAxis">
                    
          </ul>
        </div>
      </div>      
    </div>
  </div>
</div>
		
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript">
		
		var id=${id};
			//这是要遍历时间轴的数据
			var dimeAxis=[];		
			var obj=null;
			
			$(function(){
				

				function timestampToTime(timestamp) {
					   var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
					   Y = date.getFullYear() + '-';
					   M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
					   D = date.getDate() + ' ';
					   h = date.getHours() + ':';
					   m = date.getMinutes() + ':';
					   s = date.getSeconds();
					   return Y+M+D+h+m+s;
				}
				$.ajax({
                url:"${ctx}/statistics/getResourceLogById?id="+id,
                type:"post",
                data:$('#inputForm').serialize(),
                success:function(data){
					if(data!=null && data != ''){
						for(var i=0;i<data.length;i++){
							obj= new Object;
							//data[i].logDate.format("yyyy-MM-dd HH:mm:ss");
							var logDate=data[i].logDate;
							obj.date=timestampToTime(logDate);
							obj.title=data[i].event;
							obj.achievement='';
							dimeAxis.push(obj);
						}	
						$.each(dimeAxis,function(i,e){
							var html='<li class="cls">'+
										 '<p class="date">'+e.date+'<span></span></p>'+
										 '<p class="intro">'+e.title+'</p>'+
									 '</li>';
							$('#timeAxis').append(html);		
						});
					}
                }
            });
				
			});
		</script>
</body>
</html>